﻿@{
    Layout = null;
}

<!DOCTYPE html> 

<html>
<head>
    <title>Content</title>
        <script src="@Url.Content("~/Scripts/json2.js", true)" type="text/javascript"></script>
        <script src="@Url.Content("~/Common/GetRootPath.ashx", true)" type="text/javascript"></script>
     <link href="@Url.Content("~/Content/Site.css", true)" rel="stylesheet" type="text/css" />
    <script src="@Url.Content("~/Scripts/jquery.min.js", true)" type="text/javascript"></script>
  	<link rel="stylesheet" type="text/css" href="@Url.Content("~/Content/easyui.css", true)"/>
	<link rel="stylesheet" type="text/css" href="@Url.Content("~/Content/icon.css", true)"/>
	<script type="text/javascript" src="@Url.Content("~/Scripts/jquery.easyui.min.js", true)"></script>
</head>
<body>

	<div id="tt" class="easyui-tabs" data-options="tools:'#tab-tools'" style="height:500px;width:100%;">
	</div>
	<div id="tab-tools">
		<a href="javascript:void(0)" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-add'" onClick="removeAllPanel()"></a>
		@*<a href="javascript:void(0)" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-remove'" onClick="removePanel()"></a>*@
	</div>
	<script type="text/javascript">

	    function url(obj) {
	        $.ajax({
	            type: 'POST',
	            url: rootPath + '/Domes/GetUrl',
	            data: { FFunctNo: obj },
	            success: function (result) {
	                var List = JSON.parse(result);
	                var tab = $('#tt').tabs('exists', '<table cellpadding="0" cellspacing="0" ><tr><td><img src="' + rootPath + List.FPictName + '" style=" border:0px;"/></td><td  style=" padding-right:5px;padding-left:5px">' + List.FfunctName + '</td></tr></table>');
	                if (!tab) {
	                    $('#tt').tabs('add', {
	                        id: obj,
	                        title: '<table cellpadding="0" cellspacing="0" ><tr><td><img src="' + rootPath + List.FPictName + '" style=" border:0px;"/></td><td  style=" padding-right:5px;padding-left:5px">' + List.FfunctName + '</td></tr></table>',
	                        //href: rootPath + '/' + List.FfunctURL,
	                        content: '<iframe  id="contentframe name="contentframe" style="width:100%;height:100%" frameborder="0" src="' + rootPath + '/' + List.FfunctURL + '"></iframe>',
	                        closable: true
	                    });
	                }
	                else {
	                    $('#tt').tabs('select', '<table cellpadding="0" cellspacing="0" ><tr><td><img src="' + rootPath + List.FPictName + '" style=" border:0px;"/></td><td  style=" padding-right:5px;padding-left:5px">' + List.FfunctName + '</td></tr></table>');
                    }
	            }
	        });
        }

        $(document).ready(function () {
            $('#tt').tabs('add', {
                title: '<table cellpadding="0" cellspacing="0" ><tr><td><img src="' + rootPath + '/Content/images/dlicon.jpg" style=" border:0px;"/></td><td  style=" padding-right:5px;padding-left:5px">桌面</td></tr></table>',
                content: '<iframe  id="contentframe name="contentframe" style="width:100%;height:100%" frameborder="0" src="/EnterpriseFund/Domes/ContentShow"></iframe>',
                closable: false
            });
        });


//	    var index = 0;
//	    function addPanel() {
//	        index++;

//	        $('#tt').tabs('add', {
//	            title: '首页',
//	            content: '<iframe  id="contentframe name="contentframe" style="width:100%;height:100%" frameborder="0" src="/EnterpriseFund/Domes/ContentShow"></iframe>',
//	            closable: false
//	        });
//	    }
        function removeAllPanel() {
            var tab = $('#tt').tabs('tabs');
            if (tab) {
                var z = tab.length-1;
                for (var i = 0; i < z; i++) {
                    $('#tt').tabs('close', 1);
                }
	        }
	    }
	</script>
</body>
</html>
